<template>
	<view class="" @click="adlasdflj">
		<u-navbar :is-back="false" title="首页" :background="{backgroundColor:'#E62131'}"
			title-color="#ffffff"></u-navbar>
		<view class="topnams">
			<u-swiper :list="list" height="200" border-radius="0"></u-swiper>
		</view>
		<view class="lsitltets fliexs space_between">

			<view class="listtop" @click="topagesList('./classroomReport')">
				<image class="images" src="../../static/images/ketangbaogao.png" mode=""></image>
				<view class="namets">
					课堂报告
				</view>
			</view>
			<!-- <view class="listtop" @click="topagesList('./studentAdmin')">
				<image class="images" src="../../static/images/xueyuan.png" mode=""></image>
				<view class="namets">
					学员管理
				</view>
			</view> -->
			<view class="listtop" @click="topagesList('./classAttendance')">
				<image class="images" src="../../static/images/bankekaoqing.png" mode=""></image>
				<view class="namets">
					我的账务
				</view>
			</view>
			<view class="listtop" @click="topagesList('./studentLeave')">
				<image class="images" src="../../static/images/qingjia.png" mode=""></image>
				<view class="namets">
					我的请假
				</view>
			</view>
		</view>
		<view class="lsitltets fliexs space_between">
			<view class="listtop" @click="topagesList('./myCurriculum')">
				<image class="images" src="../../static/images/kebiao.png" mode=""></image>
				<view class="namets">
					我的课表
				</view>
			</view>
			<view class="listtop" @click="topagesList('./classRecord')">
				<image class="images" src="../../static/images/xuanzhong.png" mode=""></image>
				<view class="namets">
					上课记录
				</view>
			</view>
			<view class="listtop">

			</view>
		</view>

	<view class="index_top" v-if="show">
		<view class="modlo_center">
			<view class="text_qiansyu" v-if="pstatus != 1">
				你有相关课程协议未签署，请前往个人中心进行签署后在操作！！！
			</view>
			<view class="text_qiansyu" v-else>
				你相关课程协议签署无效，请前往个人中心重新签署后在操作！！！
			</view>
			<view class="" style="width: 100%; display: flex;justify-content: center;height: 70%;position: relative;">
				<view class="btnsqian" @click="topaesad">
					去签署>>>
				</view>
			</view>
		</view>
	</view>


		<!-- <nanvBar currentTab="home"></nanvBar> -->
	</view>
</template>

<script>
	// import nanvBar from "@/uview-ui/components/nanvBar.vue"
	export default {
		// components: {
		// 	nanvBar
		// },
		data() {
			return {
				show: false,
				users: null,
				pstatus:null,
				list: [{
					image: 'https://www.fbty.tech/classHourSystem/0d46830ed8c74409825cb2a0654af1eb.jpg',
				}],
			}
		},
		onLoad(options) {

		},
		onShareAppMessage(res) {
			return {
				title: '',
				path: "/pages/index/index"
			}
		},
		onShow() {
			// 本地调试
			// let str = "eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCJ9.eyJ1c2VyX25hbWUiOiJ1c2VyczcxMTE1MTU2MDg5MzI2ODA0NSIsInNjb3BlIjpbImFwcCJdLCJpZCI6ODAxLCJleHAiOjE3NTg2NTQ0NTcsInVzZXJOYW1lIjoidXNlcnM3MTExNTE1NjA4OTMyNjgwNDUiLCJhdXRob3JpdGllcyI6WyJwYXJlbnQiXSwianRpIjoiODRlNzcwMGMtODhkYy00ZWEwLTkxNDgtNDg2NWJmOTA4MjkwIiwiY2xpZW50X2lkIjoiZGV2V2ViIn0.NkZ4VSNlzWZShoPGJetfoabmc_zKNLUsTS951sOaosWGP14koAqVYN-GVbIdRwx5AEZ5Ae3xdIqEZx_VfsLD7ghawuEA1M5GkAjMM0liHWa_ooKIICNhQQ-jDcvrgkupBtoT9rORoukCICDrsHz9pMP_cZd8iWQXeCuHnEUeAB4Kyzr-LBytlFbkeQgEHTyzHZuJNiKCCWCpgk5BJh479V3wxdoHDu2dUYbqBFTleOfqS-fOh2yi7o5mDOUsbHJaVPIE716CAV01lG6KK_46PPId7ldv91icetsjnpkjnUosKVDiUdzpmrdYqGRFGJ9bTtjzTN2vgAM5auq52xAgXg"

			// uni.$func.cache("token", str)
			
			
			uni.$api.common.userscurrent().then((res) => {
				uni.$func.cache("userInfo", res.result)
				if(!res.result.isSign || res.result.pstatus == 1){
					this.show = true
					this.pstatus =  res.result.pstatus
				}else{
					this.show = false
				}
				uni.switchTab({
					url: "./indexlist"
				})
			});
		},
		onReachBottom() {

		},
		methods: {
			confirm() {

			},
			getUserInfoApi() {
				uni.$api.common.getUserInfo().then((res) => {
					this.users = res.result
				});
			},
			topagesList(url) {
				uni.navigateTo({
					url
				})
			},
			topaesad() {
				uni.navigateTo({
					url: "../me/singDetail"
				})
			},
		}
	}
</script>

<style lang="scss">
	.index_top{
		width: 100%;
		height: 100%;
		z-index: 9999;
		background: rgba(0, 0, 0, 0.5);
		position: fixed;
		top: 0;
		left: 0;
		right: 0;
		bottom: 0;
		display: flex;
		align-items: center;
		justify-content: center;
		.modlo_center{
			width: 80%;
			height: 300rpx;
			padding: 30rpx;
			border-radius: 20rpx;
			background-color: #ffffff;
			.text_qiansyu{
				color: #E62131;
				text-align: center;
			}
			.btnsqian{
				width: 60%;
				height: 70rpx;
				border-radius: 20rpx;
				border:1rpx solid #E62131;
				position: relative;
				text-align: center;
				color: #E62131;
				left: 0rpx;
				right: 0rpx;
				padding: 20rpx;
				margin-top: 20px;
				bottom: -30rpx;
				
			}
		}
	}
	.topnams {
		width: 100%;
		// padding:20rpx;
		text-align: center;
		color: #ffffff;
		margin-bottom: 40rpx;

		.imagelogos {
			margin-top: 100rpx;
			width: 100rpx;
			height: 100rpx;
			border-radius: 50%;
		}

		.nematest {
			font-size: 26rpx;
			margin: 20rpx 0;
		}

		.names {
			font-weight: 32rpx;
			font-weight: bold;
		}
	}

	.listads {
		border-bottom: 1px solid #F5F5F5;
		width: 100%;
		height: 200rpx;
		margin-bottom: 100rpx;

		.lists {
			width: 49%;
			height: 200rpx;

			font-size: 30rpx;

			.texts {
				color: #000000;
				text-align: center;
				width: 100%;
				margin-bottom: 30rpx;
			}

			.pricenum {
				font-size: 40rpx;
				font-weight: 600;
				color: #E62131;
				text-align: center;
			}

			.nums {
				font-weight: bold;
				text-align: center;
			}
		}

		.centerborder {
			width: 1px;
			background-color: #F5F5F5;
			height: 80%;
		}
	}

	.lsitltets {
		// padding: 0 30rpx;
		margin-bottom: 40rpx;

		.listtop {
			width: 33%;
			text-align: center;
			font-size: 32rpx;

			// color: #E62131;
			image {
				width: 60rpx;
				height: 60rpx;
				margin-bottom: 30rpx;
			}
		}
	}

	.outlogin {
		width: 40%;
		padding: 20rpx 0;
		text-align: center;
		color: #ffffff;
		border-radius: 50rpx;
		background-color: #E62131;
		margin: 0 auto;
		margin-top: 150rpx;
	}
</style>